const ExtractTextPlugin = require("extract-text-webpack-plugin");


module.exports = {
    rules:[
        {
            test: /\.css$/,
            use: ExtractTextPlugin.extract({
                use:['css-loader','postcss-loader'],
                fallback: "style-loader"
            })
        },
        {
            test:/\.less$/,
            //use:['style-loader','css-loader','less-loader']
            use:ExtractTextPlugin.extract({
                fallback:'style-loader',
                use:['css-loader','less-loader']
            })
        },
        {
            test:/\.(sass|scss)$/,
            use:['style-loader','css-loader','sass-loader']
        },
        {
            test:/\.(js|jsx)$/,
            use:['babel-loader'],
            exclude:/node_modules/
        },
        {
            test:/\.(png|jpg|gif)$/,
            use:[{
                loader:'url-loader',
                options:{
                    limit:50,
                    outputPath:'images'
                }
            }]
        }

    ]
};